Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

Why would the following be an inappropriate use of an overloaded operator?coord coord:: operator%(coord ob) {double i;cout << "Enter a number:";cin >>i;cout << "root of...

Why would the following be an inappropriate use of an overloaded operator?
coord coord:: operator%(coord ob)
{
double i;
cout << "Enter a number:";
cin >>i;
cout << "root of " << i << "is ";
cout << ();
}

Answers


Davis
The overloading of the % operator is inappropriate because its operation is unrelated to the traditional use.
Githiari answered the question on May 31, 2018 at 17:56

Answer Attachments

Exams With Marking Schemes

Related Questions